import axios from "axios";

// 创建axios实例
const server = axios.create({
  baseURL: "/vueQiLai",
  timeout: 500000,
});

// axios请求拦截器
server.interceptors.request.use(
  (config) => {
    return config;
  },
  (e) => Promise.reject(e)
);

// axios响应式拦截器
server.interceptors.response.use(
  (res) => res.data,
  (e) => {
    //统一处理响应报错

    return Promise.reject(e);
  }
);

export default server;
